<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'desk.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link rel="stylesheet" href="${ctx}/resources/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" type="text/css" href="${ctx}/resources/easyui/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/resources/css/wu.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/resources/css/icon.css" />
<script type="text/javascript" src="${ctx}/resources/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="${ctx}/resources/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${ctx}/resources/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${ctx}/resources/zTree/js/jquery.ztree.core.js"></script>
  </head>
  
  <body>
  <div class="easyui-layout" style="width：100%;height:300px">
  <div class="easyui-panel" style="width: 70%" data-options="region:'center',iconCls:'icon-save',split:true,border:true,title:'系统公告'">
   			 <table id="table" class="easyui-datagrid" style="width:100%;height:300px">
    </table>
   			</div>
  <div class="easyui-panel" style="width: 30%" data-options="region:'east',iconCls:'icon-save',split:true,border:true,title:'系统公告'">
   			<div class="easyui-calendar" data-options="border:false" style="width:100%;height:100%;"></div>
   		</div>
  </div>
  <!-- 添加和修改新闻的弹出层 开始 -->
	
		<div id="dlg" class="easyui-dialog" style="width:650px" data-options="title:'新闻内容',closed:true,modal:true,border:'thin',buttons:'#dlg-buttons'">
		
			<!-- 弹出层页面三大布局 -->
				<div class="easyui-layout" style="width: 100%; height: 300px">
				
					<!--布局，北，标题  -->
					<div id="title" class="easyui-panel" style="width: 100%;height:50px;font-size: 20px;text-align: center;padding-top: 5px"
							data-options="region:'north',split:true,border:true">	
						</div>
					
					<!--布局，中，作者和发布时间  -->
						<div id="author" class="easyui-panel" style="width: 100%;height:20px;font-size: 10px;text-align: right;"
							data-options="region:'center',split:true,border:true">
						</div>
					
						<!--布局，南，发布的内容 -->
						<div id="content" class="easyui-panel" style="width: 100%;height:230px;font-size: 10px;"
							data-options="region:'south',split:true,border:true">
						</div>
				</div>
			<!-- 弹出层页面三大布局 结束-->
		</div>
		
	 <div id="dlg-buttons">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')" style="width:90px">取消</a>
    </div>
	
	<!-- 添加和修改新闻的弹出层 结束 -->
  <script type="text/javascript">
  $("#table").datagrid({
		title:'用户列表',
		singleSelect:true,
		collapsible:true,
      fitColumns:true,
      pagination:true,
    /*   pagePosition:'both', */
     pageSize:5,
      pageList:[5,10,15,20], 
      rownumbers:true,
      toolbar:'#tb',               //添加，修改和删除的标签
      url:'${ctx}/news/loadAllNews.action',
     // method:'get',
      columns:[[
               
                {field:'title',title:'新闻标题',align:'center',width:100},
                {field:'createtime',title:'发布时间',align:'center',width:100},
                {field:'opername',title:'发布人',align:'center',width:100},
            ]],
            onDblClickRow: function (rowIndex,rowData) {
            	showNews(rowData);
            }
	});
	function showNews(rowData){
		 $("#dlg").dialog('open');
		 $('#title').html(rowData.title);
		 $('#author').html('作者：'+rowData.opername+'       发布时间：'+rowData.createtime+'      ');
		 $('#content').html(rowData.content); 
		 
	}
  </script>
  </body>
</html>
